Cloud inversion analysis of surrounding rock parameters for underground powerhouse based on PSO-BP optimized neural network and web technology

Aiming at the shortcomings of the BP neural network in practical applications, such as easy to fall into local extremum and slow convergence speed, we optimized the initial weights and thresholds of the BP neural network using the particle swarm optimization (PSO). Additionally, cloud computing service, web technology, cloud database and numerical simulation were integrated to construct an intelligent feedback analysis cloud program for underground engineering safety monitoring based on the PSO-BP algorithm. The program could conveniently, quickly, and intelligently carry out numerical analysis of underground engineering and dynamic feedback analysis of surrounding rock parameters. The program was applied to the cloud inversion analysis of the surrounding rock parameters for the underground powerhouse of the Shuangjiangkou Hydropower Station. The calculated displacement simulated with the back-analyzed parameters matches the measured displacement very well. The posterior variance evaluation shows that the posterior error ratio is 0.045 and the small error probability is 0.999. The evaluation results indicate that the intelligent feedback analysis cloud program has high accuracy and can be applied to engineering practice.


Intelligent feedback analysis cloud program based on the PSO-BP algorithm PSO-BP optimized neural network
BP neural network is a multi-layer feedforward network trained by data error reverse transfer algorithm 48 .Its network structure can contain multiple hidden layers.Theoretically, it can realize the nonlinear mapping from n-dimensional input space to h-dimensional output space 49 , so it could construct the nonlinear relationship between structural displacements and surrounding rock parameters.
Figure 2 shows a typical topological structure of a BP neural network.Usually, a BP neural network consists of one input layer, one to multiple hidden layers, and one output layer.Each layer contains a number of nodes.When the number of input nodes is n, and the number of output nodes is h, the network is a mapping function from n independent variables to h dependent variables.
During the training process of the BP neural network, the deviation between the expected output and the actual output of the network keeps updating, and the weights and thresholds are adjusted automatically according to the deviation.Then, the deviation gradually decreases along the gradient direction until the accuracy requirement is met.The weights and thresholds that result in the convergency could be determined as a proper network for the parameter prediction of the surrounding rock.Therefore, the BP neural network can approach an unknown function with multiple independent and dependent variables through training.
Kennedy and Eberhart 50 proposed the particle swarm optimization algorithm based on the principle of bird foraging, which is an effective global optimization algorithm.Particle swarm optimization (PSO) has the concept of population and evolution.The evolution of the population is the iterative calculation of the PSO algorithm.In each iteration, two extreme values are always concerned.One is the optimal position p best (individual extreme value) of each particle in the iterative history, and the other is the optimal position g best (global extreme value) of the whole particle swarm in the iterative history.After these two values are updated, the particles continuously change their velocity and position to obtain different fitness values.The fitness values obtained each time are compared with the fitness values of individual extremum and global extremum to obtain new individual extremum and fitness values.After cycles, the global optimal solution can be determined.
To improve the convergence performance of the PSO algorithm, Shi and Eberhart 51 proposed a particle swarm optimization algorithm with an inertia weight factor w. In an M-dimensional target search space, for a group  www.nature.com/scientificreports/with N particles, when the t-th iteration obtains the optimal position, the position and velocity of a particle i in the j-dimensional component can be updated as 19,33,51 : where x ij and v ij are the position and velocity of the ith particle on the jth dimensional component, respectively; p best_ij and g best_ij are the individual extremum and the global extremum of the ith particle on the jth dimensional component, respectively; c 1 and c 2 are acceleration constants, generally c 1 = c 2 = 1.5-2.5;r 1 and r 2 are random numbers of 0 ~ 1; w is called the inertia weight, and the value of w has a significant influence on the optimization ability of particle swarm optimization.If the value of w is large, the algorithm has a strong ability in global optimization.If the value of w is small, the algorithm has a strong ability in local search.In the iterative process, the inertia weight w follows the linear attenuation weight strategy 33,51 : where t is the current iteration number; and t max is the maximum number of iterations; in general, w min = 0.8 and w max = 1.2.
In the practical application of solving complex nonlinear problems, the initial parameters of the BP neural network structure are difficult to determine.On the one hand, the BP neural network needs to initialize many parameters, such as network layers, nodes, weights, thresholds, iterations, and error tolerance.These parameters can only be given roughly according to experience, which may not be suitable for a specific problem.On the other hand, the BP neural network is susceptible to the initial weights.A small change of that will lead to fall into local extremum.The reason is that the BP neural network is based on the gradient descent.From a mathematical perspective, there must be local minima when using the gradient descent method to solve the minimum problem, and the algorithm is prone to falling into local minima.It cannot obtain the global optimal solution.The particle swarm optimization is a global algorithm and does not have local convergence issues.Therefore, the optimization ability of the PSO algorithm is used to optimize the initial weights and thresholds of the BP neural network, to improve the speed of convergence and the accuracy of results.The process of optimizing the BP neural network by the PSO is shown in Fig. 3.The specific implementation steps are as follows: (1)

Intelligent feedback analysis cloud program for underground engineering safety monitoring
The PSO-BP optimized neural network, numerical simulation, cloud computing services, web technology, and cloud database were integrated to construct an intelligent feedback analysis cloud program for underground engineering safety monitoring.The program can perform intelligent real-time feedback cloud analysis through cloud computing services.The user only needs to log on to the web page platform and execute some simple operations, and the program automatically performs simulation calculations and quickly output inversion analysis results.
The basic structure of the program is shown in Fig. 4. In this paper, the web cloud platform includes a web client (front-end) and a web server (background) 52 .The front-end is a direct object for users to manage monitoring data and control numerical calculation, while the background is to complete data storage, software invocation, numerical simulation, and parameter inversion.Web application development is mainly based on Browser/ Server (B/S) structure mode.The front-end collects data input by user and sends it to the server, and the server www.nature.com/scientificreports/responds to the front-end after completing data processing.In this program, the front-end is developed based on the Bootstrap framework, and the background server is developed by Hypertext Preprocessor (PHP).The front-end is deployed on the cloud server.Moreover, the cloud computing service is on the Huawei Elastic Cloud Server (ECS), and the GaussDB (for MySQL) cloud database is built on the ECS to store the monitoring data.
Multiple languages, such as the Fish language of FLAC 3D , MATLAB, Python and PHP, were used to systematically develop the intelligent feedback analysis program for calling software, executing commands, and exchanging data in the background of the server.The remote interface control of the intelligent feedback analysis program was realized through the web platform on the front-end.The back analysis process of the program can be divided into three stages, including pre-processing, calculating, and post-processing, as shown in Fig. 5.
1.The pre-processing includes model initialization and optional in-situ stress inversion, which could also be inversely analyzed by the PSO-BP algorithm and has already been investigated by the authors' coworker 53 .
The items and models saved in the database should be selected in the pre-processing.After the initial parameters, such as material parameters and measured in-situ stress, are input, the initial model can be generated.If the measured in-situ stress is input, the program will perform the in-situ stress inversion automatically.
Otherwise, the initial model is only subjected to gravity.Subsequently, FLAC 3D is called to generate displacement boundaries and initial stress field for the numerical model, which will used for the following excavation simulation and inversion analysis of surrounding rock parameter.The pre-processing interface is shown in Fig. 6. 2. The calculating process includes excavation simulations to generate training samples and inversed analysis of surrounding rock parameters.Firstly, the computing control interface shown in Fig. 7 is generated based on the excavation information uploaded to the cloud database.Secondly, the user must assign the zones that need to be excavated for every step.Figure 7 shows a three-bench excavation process of a tunnel with a footage of 3 m.The gray fillings represent the excavated parts, and the orange fillings represent the parts that will be excavated in current excavation step.The rock to be excavated is selected for each calculation step.By clicking the "compute" button, the program will call the FLAC 3D to complete the excavation simula- tion and return the results.Thirdly, before sending the simulation instruction, user can choose whether to inversely analyze the surrounding rock parameters for the current excavation step.If inversion analysis is not selected, the program will simulate the excavation using the initial parameters of the surrounding rock.
If inversion analysis is selected, the displacements and coordinates of the monitoring points should be input or automatically called from monitoring database if pre-defined, and the program of the PSO-BP optimized neural network will be executed for parameter inversion analysis.The procedure of the inversion analysis can be summarized as follows.The program generates a series of orthogonal experiments based on the initial parameters of the surrounding rock and runs these numerical simulations automatically to obtain training samples.In addition, the program for the inversion analysis is called in the background to train the network and establish a nonlinear relationship between the displacements and the parameters of surrounding rock.Finally, the program predicts the surrounding rock parameters by substituting the monitored displacements into the trained network.Based on the back-analyzed parameters, the program simulates the excavation again for the current excavation step as the final result.3. The post-processing includes the visualization of the results.The concerned excavation steps could be selected on the web platform, and the control data of visualization, such as section direction and coordinates, should be input.The program will quickly generate the displacement and stress distribution and return them to the web platform.For example, Fig. 8 shows the displacement and stress distribution of a cavern after the fifth step of excavation.In addition, more visions can be generated by clicking the "more" button, such as the back-

Engineering overview
The Shuangjiangkou Hydropower Station is located in Jinchuan County, Aba Tibetan and Qiang Autonomous Prefecture, Sichuan Province, China.The normal storage elevation of the reservoir is 2500 m, the total storage capacity is 2.897 billion m 3 , and the regulating storage capacity is 1.917 billion m 3 .The installed capacity of the power station is 2000 MW, and the average annual power generation is 7.707 billion kW•h.The surrounding rock of the underground powerhouse mainly consists of porphyritic biotite K-feldspar granite.A lamprophyre vein is developed around the underground powerhouse.Its width is about 0.8-1 m, and its surfaces are staggered and eroded into a 3-5 cm clastic rock.The fault numbered as F1 is developed around the underground powerhouse, and it has an occurrence of N79°W/SW∠48° and a crushing bandwidth of 50-60 cm.It is comprised of clastic rocks and contains a layer of secondary mud, whose thickness is about 1-4 mm.Dripping water could fall from the fault F1.The surrounding rock has a good integrity, and its structure presents as a large block structure.The wall of the exploration tunnel is dry, and seepage, drip water and slight flowing water were observed in a few tunnel sections.Thus, most of the surrounding rock is classified as class IIIa, and the surrounding rock near the faults and lamprophyre veins are classified as class IV-V in the geological survey report of the Shuangjiangkou Hydropower Station.The quality of rock mass is generally good for the construction of the underground powerhouse.The maximum principal stress has a small angle with the axis of the underground powerhouse, which is beneficial to the overall stability of the cavern.However, its top arch, side walls, and end walls are affected by the lamprophyre veins and different structural planes, and the local stability is poor around these unfavorable geological structures.

Excavation and support scheme of underground powerhouse
The excavation scheme of the Shuangjiangkou underground powerhouse is shown in Fig. 9.The excavation of the underground powerhouse is mainly divided into eight construction periods.The three major caverns are excavated in parallel during the corresponding construction period.As of March 2022, the Shuangjiangkou underground powerhouse has been excavated to the fourth layer.The multi-point displacement meters were installed after the surrounding rock at the installation position was exposed.After the first layer of excavation, only several multi-point displacement meters were installed, so the monitoring results of the first layer cannot represent the deformation of the completely excavated powerhouse and are not suitable for inversion analysis.After the fourth layer of excavation, the excavated underground cavern is large enough to reveal the properties of surrounding rock.Therefore, the monitoring data from the initial four stages of excavation were chosen to inversely analyze the mechanical parameters of surrounding rock.
The supporting structures of the underground powerhouse include shotcrete, anchors and steel meshes.The shotcrete thickness is 15 cm, and its concrete grade is C25.Two kinds of anchors including ordinary mortar anchors and pre-stressed anchors were used to support the vault, side wall, and end wall of the underground powerhouse, and the anchors have a spacing of 1.5 m × 1.5 m.The grade of ordinary mortar used for anchors is M30.The support scheme of the Shuangjiangkou underground powerhouse is shown in Fig. 10.To optimize the mesh, using one-tenth of the minimum edge length of the underground cavern as the mesh edge length not only ensures the precision of the mesh but also does not cause excessive mesh quantity.The numerical model imported into FLAC 3D is shown in Fig. 11.A total of 477,685 nodes and 753,151 elements are meshed in the model.The elements are mainly hexahedral elements with eight-node, and their shapes are good.The strength criterion follows the Mohr-Coulomb criterion.The unbalanced force of convergence is set to the default value of 10 −5 .The link elements were used to simulate the ordinary mortar anchors and the pre-stressed anchors.
Based on the in-situ stress measurement results around the Shuangjiangkou underground powerhouse, the initial in-situ stress field and boundary conditions of this numerical model has been inversely analyzed by the authors' coworkers 53 .Their work on the back analysis of the in-situ stress is also an important work integrated in the cloud program, so their analysis results of the in-situ stress were directly used in the back analysis of surrounding rock parameters.Initially, normal displacement constraints were applied on the bottom, left, and back sides of the model, and the back-analyzed stress conditions were applied on their corresponding boundaries.
The geological conditions of the studied area include fresh granite, weakly weathered granite, strongly weathered granite, lamprophyre vein, and fault.Before the simulation, their mechanical and other necessary parameters were input on the web platform.These parameters were obtained from the geological survey report of the Shuangjiangkou Hydropower Station and are listed in Table 1.

Training samples
The PSO-BP back analysis method was used to analyze the parameters of the surrounding rock.The fault F1 crosses the main powerhouse around the 3# electric generator, so the cross section of the 3# electric generator   www.nature.com/scientificreports/ was chosen as the characteristic section to conduct the back analysis.As shown in Fig. 12, the section contains 10 multi-point displacement meters, which record the displacement of 10 points on the surface of the excavated cavern.The monitoring data measured from only six of them (marked in red) are used for back analysis to control the number of samples.These six multi-point displacement meters are chosen alternately to keep the accuracy, as listed in Table 2. Besides, the displacement increments of these six meters during the fourth layer of excavation are taken as the target of the back analysis.
The surrounding rock parameters considered in the back analysis include the deformation parameters and the Mohr-Coulomb strength parameters, i.e., modulus E, Poisson's ratio μ, internal friction angle φ, and cohesion c.The initial parameters of surrounding rock are obtained from the geological survey report of the Shuangjiangkou Hydropower Station, as listed in Table 3.
According to the principle of orthogonal design 54,55 , the web cloud platform was used to carry out the orthogonal experiments to obtain some sample data.There were four mechanical parameters of surrounding rock in the back analysis, and seven values of each parameter were designed, i.e., 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, and 1.3 times of its initial value listed in Table 3.Thus, the orthogonal test scheme table was designed as L 49 (7 4 ) , which was integrated into the intelligent feedback analysis cloud program.After inputting the initial surrounding rock parameters on the web platform, the program automatically generated an orthogonal test plan, as listed in Table 4.

Network training
The program called FLAC 3D in the server to carry out 49 groups of numerical simulations to obtain the displacement increment of surrounding rock during the fourth layer of excavation.It outputted the displacement increments of six monitoring points listed in Table 2.After the numerical simulations, the Matlab was automatically called for network training.
The simulated displacement increments of six monitoring point were taken as the input samples, and the surrounding rock parameters of each numerical simulation were taken as the output samples.The PSO-BP network were trained by these input and output samples.The parameters of the neural network were initialized as follows.The number of nodes in the hidden layer is 13, and the transfer function is tansig.The number of the output layer is 4, and the transfer function is purelin.Therefore, a 6-13-4 topology network were preset in the program, as shown in Fig. 13.The network function of error backpropagation was selected as the newff function, and the training function was selected as the trainscg function.The maximum number of network training was set to 300,000, the learning rate was set to 0.001, and the target tolerance was set to 10 −6 .
The parameters of the PSO were initialized as follows.The group size N was set to 60, the maximum number of iterations t max was set to 300, the maximum particle velocity v max was set to 0.5, the particle acceleration constants c 1 and c 2 were set to 2, the inertia weight was taken as [w min , w max ] = [0.8,1.2] , and the other parameters were taken as the default values in Matlab.Figure 13 shows that there are 6 × 13 + 13 + 13 × 4 + 4 + 4 × 4 + 4 = 167 weights and thresholds to be optimized, so the particle swarm dimension M was set to 167.
The optimum fitness curve 54,55 of the PSO algorithm is shown in Fig. 14.The best fitness was found after the population had been iterated about 110 times.The particle position of the best fitness was used as the initial weight and threshold of the BP neural network, and then the network training was carried out.The variation of the mean square error during the training is shown in Fig. 15.It shows that the network training finished when the maximum number of network training is 300,000, and the mean square error is less than 0.0012.

Back analysis of surrounding rock parameters
The trained PSO-BP network was further used to inversely analyze the surrounding rock parameters of the Shuangjiangkou underground powerhouse.To verify the advantages of the PSO-BP, both the PSO-BP and the BP methods were used to inversely analyze the parameters of the surrounding rock.The network structures of the two methods are consistent.The measured displacement increments of six monitoring points listed in www.nature.com/scientificreports/Table 2 were used as the input data of these two network, and the output surrounding rock parameters are listed in Table 5.
The back-analyzed parameters of surrounding rock in Table 5 were substituted into the numerical model to simulate the fourth layer of excavation of the underground powerhouse, and the displacement increments of surrounding rock in the fourth layer of excavation was obtained.Figure 16 shows the distribution of displacement increments calculated by the PSO-BP method in the section of 3# electric generator.It shows that the deformation increment caused by the fourth layer of excavation mainly occurs in the newly exposed surrounding rock of the excavation, and the surrounding rock deforms to the free surface of the cavern.The maximum horizontal displacement increment is 7.6 mm and occurs on the upstream side wall of the main powerhouse, and the maximum horizontal displacement increment on the downstream side wall is about 6 mm.The deformation increment of the surrounding rock at the vault is small, so the fourth layer of excavation has little effect on its deformation.
Figure 17 shows the measured, originally analyzed and inversely analyzed horizontal displacement increments of six monitoring points in the section of 3# electric generator.The originally analyzed displacement increments with the initial mechanical parameters are much larger than the measured displacement increments, and the inversely analyzed displacement increments are closer to the measured displacement increments.increment obtained by the BP method and the measured value is 1.05, and the mean relative error is 54.07%.The mean squared error between the displacement increment obtained by the PSO-BP method and the measured value is 0.22, and the mean relative error is 31.25%.Thus, the back-analyzed parameters obtained by the PSO-BP method reflect the mechanical properties of the surrounding rock better than the parameters obtained by the BP method.

Accuracy evaluation of the inversion analysis
In this paper, the posterior variance method 56 was used to objectively evaluate the accuracy of the PSO-BP inversion analysis.The displacement increment is used to evaluate the inversion results.The evaluation process is as follows 57,58 .
1. Displacement increment residual: (5)   where ε(i) is the residual error of displacement increment of the measuring point i; x(i) is the measured displacement increment of the measuring point i; x(i) is the numerically calculated displacement increment of the measuring point i; n is the number of measuring points.

Mean of the displacement increment residuals:
Mean square error of the displacement increment residuals:

Mean of the measured displacements:
Mean square error of the measured displacement: x(i) where C is the posterior error ratio; P is the probability of a small error.According to these two indexes of the posterior variance method, the evaluation grades 57,58 are classified into four levels as shown in Table 7.
The measured and inversely analyzed displacement increments were further analyzed by the posterior variance method.The analysis results including residuals, mean square error of residuals and displacement increments, and the indexes of the posterior variance method are shown in Table 8.The posterior error ratio C = 0.045 is smaller than 0.35 and indicates the evaluation grade is excellent.The probability of small error P = 0.999 is

Conclusion
The BP neural network is sensitive to the initial parameters, so the global optimization ability of the PSO is used to optimize the initial weights and thresholds of the BP neural network.The PSO-BP algorithm and the cloud computing technology were integrated into an intelligent feedback analysis cloud program for underground engineering safety monitoring to facilitate real-time feedback analysis of surrounding rock parameters.The program was constructed with a web platform and a cloud server.The web platform was designed as simple as possible to make user easily input some necessary and basic parameters, and all the professional software were called by the program to automatically run the simulations in the could server.The program provides a practical path for users to conveniently, quickly, and intelligently carry out numerical simulations of an underground engineering and feedback analysis of surrounding rock parameters.The cloud program was further applied to the feedback analysis of the surrounding rock parameters of the Shuangjiangkou underground powerhouse.The elastoplastic mechanical parameters of surrounding rock were inversely obtained based on the measured displacement increments during the fourth layer of excavation.By comparing the originally and inversely simulated displacement increments with the measured displacement increments, the originally simulated displacement increments are much larger than the measured values, and the inversely simulated displacement increments are closer to the measured values.The analysis results of the posterior variance method show that the posterior error ratio of the inversely simulated displacement increments is C = 0.045, and the probability of small error is P = 0.999.These two indexes of the posterior variance method demonstrate the evaluation grade of the back analysis is excellent, so the intelligent feedback analysis cloud program is feasible in practical engineering application.

Figure 1 .
Figure 1.The structure of the study.

Figure 2 .
Figure 2. Topological structure of a BP neural network.

Figure 4 .
Figure 4. Basic structure of intelligent feedback analysis cloud program for underground engineering safety monitoring.

Figure 5 .
Figure 5. Flow chart of intelligent back analysis.

Figure 6 .
Figure 6.Pre-processing control interface on the web platform.

Figure 7 .
Figure 7. Computing control interface on the web platform.

Figure 8 .
Figure 8. Post-processing control interface on the web platform.

Figure 14 .
Figure 14.Optimum fitness curve of the PSO algorithm.

Figure 15 .
Figure 15.Variation of the mean square error during the BP network training.

Figure 16 .
Figure 16.Displacement increment distribution of surrounding rock in the section of 3# electric generator during the fourth stage layer of excavation (unit: m).(a) horizontal displacement increment and (b) vertical displacement increment.

Figure 17 .
Figure 17.Comparison of the measured, originally analyzed and inversely analyzed horizontal displacement increments of six monitoring points in the section of 3# electric generator.
. Establish the BP neural network structure, and set the number of nodes in the input layer, hidden layer, output layer, and other initial network parameters.2. Initiate particle swarm parameters, such as population size N, particle position x i and velocity v i , inertia weight w, acceleration constants c 1 and c 2 , maximum velocity v max , and maximum number of iterations; the dimension M of the particle is the sum of all weights and thresholds of neural network.If the numbers of nodes in the input layer, hidden layer, and output layer of a three-layer BP network structure are n, m, and h, respectively, the dimension of the particle swarm is: Iteratively update the particle position x i and velocity v i , and ensure that the velocity and position do not exceed the limited range.7. Termination conditions.If the maximum number of iterations is completed or the fitness[i] meets the accuracy requirements, the iteration is terminated.Then, the optimal result is output.Otherwise, return to step (3).

Table 1 .
The mechanical parameters of numerical model.

Table 2 .
Measured displacement increments of five monitoring points during the fourth layer of excavation.

Table 3 .
Initial parameters of surrounding rock of the Shuangjiangkou powerhouse.

Table 6
lists the displacement increments calculated by two methods.The mean squared error between the displacement

Table 4 .
Orthogonal test scheme of rock parameters.Figure 13.PSO-BP neural network structure.

Table 5 .
Back-analyzed surrounding rock parameters of the Shuangjiangkou underground powerhouse.

Table 6 .
Comparison of measured displacement increments and calculated displacement increments based on BP and PSO-BP methods (unit: mm).

Table 7 .
Evaluation grades based on the indexes of the posterior variance method.Unqualified larger than 0.95 and also indicates the evaluation grade is excellent.Therefore, the overall evaluation grade of the back analysis is excellent.

Table 8 .
The evaluation grade of the back analysis based on the posterior variance method.